﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediPlatform.Domain.Order
{
    /// <summary>
    /// 用户主表
    /// </summary>
    public class User
    {
        /// <summary>
        /// 主键，自增
        /// </summary>
        [Key]
        public long? Id { get; set; }

        /// <summary>
        /// 唯一用户编号
        /// </summary>

        [StringLength(64)]
        public string? UserId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>

        [StringLength(50)]
        public string? Username { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>

        [StringLength(100)]
        public string? Email { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>

        [StringLength(20)]
        public string? PhoneNumber { get; set; }

        /// <summary>
        /// 密码哈希值
        /// </summary>

        [StringLength(255)]
        public string? PasswordHash { get; set; }

        /// <summary>
        /// 用户角色：如 'patient', 'doctor', 'admin', 'user'
        /// </summary>

        [StringLength(50)]
        public string? Role { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>

        public DateTime? CreatedAt { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>

        public DateTime? UpdatedAt { get; set; } = DateTime.Now;
    }
}
